package com.itheima.huikebackend.controller;

import com.itheima.huikebackend.common.PageResult;
import com.itheima.huikebackend.common.R;
import com.itheima.huikebackend.common.Result;
import com.itheima.huikebackend.dto.RoleDTO;
import com.itheima.huikebackend.dto.RoleInsertDTO;
import com.itheima.huikebackend.service.RoleService;
import com.itheima.huikebackend.vo.RoleVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: RoleController
 * @description: 系统管理（角色管理）
 * @author: zhao qianfeng
 * @date: 2023年08月07日
 * @version: 1.0
 */
@RestController
@RequestMapping("/system")
@Slf4j
@RequiredArgsConstructor
public class RoleController {
    private final RoleService roleService;

    /**
     *角色分页
     * @return
     */
    @GetMapping("/role/list")
    public R page(RoleDTO roleDTO){
        HashMap map = roleService.page(roleDTO);
        return R.success(map);
    }

    @GetMapping("/menu/treeselect")
    public Result<?> treeselect(RoleInsertDTO roleInsertDTO){
//        roleService.insert(roleInsertDTO);
        return null;
    }
}
